﻿// ע�

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using IotContract.Models;

namespace IotContract.Interfaces;
public interface IMqttManager
{
    /// <summary>
    /// MQTT服务启动
    /// </summary>
    /// <returns></returns>
    public Task<bool> InitAsync();
    public Task<bool> StartAsync();
    public Task<bool> StopAsync();
    /// <summary>
    /// mqtt发布
    /// </summary>
    /// <param name="topic">发布主题</param>
    /// <param name="data">发布内容</param>
    /// <param name="qsl">服务质量: 0,AtMostOnce;1,AtLeastOnce;2,ExactlyOnce</param>
    /// <param name="isRetain">服务端是否保留消息,如果有新的订阅者连接，就会立马收到该消息</param>
    /// <param name="senderClientId">服务质量</param>
    public Task<bool> PublishData(string topic, string data, int qsl, bool isRetain, string? senderClientId = "");

    public object GetMqttServer();
}
